function deepClone(target, obj) {
    if (typeof target !== 'object') {
        var target = {};
    }
    if (typeof obj !== 'object') {
        var obj = {};
    }
    for (var i in obj) {
        if (typeof obj[i] === 'object') {
            target[i] = deepClone(target[i], obj[i]);
        } else {
            target[i] = obj[i];
        }
    }
    return target;
}
$.fn.extend({
    fixedFollow: function(config) {
        if (!config || typeof config !== 'object') {
            var config = {};
        }
        config = deepClone({
            duration: 1000,
            top: 700
        }, config);

        var self = this[0];
        $(self).css({
            position: 'absolute',
            top: config.top,
            right: 0,
            zIndex: 9999
        });


        $(window).on('scroll', function() {
            $(self).stop().animate({
                position: 'absolute',
                top: $(document).scrollTop() + config.top,
                right: 0,
                zIndex: 9999
            }, config.duration, 'swing')
        })
    }
})